package com.minimalist.common.entity.tc.entity.vo.plateNumber;

import com.minimalist.common.config.mybatis.bo.PageReq;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

/**
 * 停车_车牌查询实体
 * <p>
 * 用于查询车牌信息的查询条件封装，继承分页查询基类
 * 支持按车牌名称、车型等条件进行查询
 *
 * @author 11987
 */
@Schema(name = "停车_车牌查询实体")
public class TcPlateNumberQueryVO extends PageReq implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    // ========== 查询条件字段 ==========

    /**
     * 车牌名称
     */
    @NotNull(message = "车牌名称不能为空", groups = {Add.class, Update.class})
    @Schema(name = "plateNumberName", description = "车牌名称", type = "string")
    private String plateNumberName;

    /**
     * 车型名称
     */
    @Schema(name = "vehicleModel", description = "车型名称", type = "string")
    private String vehicleModel;

    // ========== 构造函数 ==========

    /**
     * 默认构造函数
     */
    public TcPlateNumberQueryVO(){
    }

    /**
     * 全参数构造函数
     *
     * @param pageNum         页码
     * @param pageSize        页大小
     * @param plateNumberName 车牌名称
     * @param vehicleModel    车型名称
     */
    public TcPlateNumberQueryVO(Long pageNum, Long pageSize, String plateNumberName, String vehicleModel){
        super(pageNum, pageSize);
        this.plateNumberName = plateNumberName;
        this.vehicleModel = vehicleModel;
    }

    /**
     * 基本参数构造函数
     *
     * @param plateNumberName 车牌名称
     * @param vehicleModel    车型名称
     */
    public TcPlateNumberQueryVO(String plateNumberName, String vehicleModel){
        this.plateNumberName = plateNumberName;
        this.vehicleModel = vehicleModel;
    }

    // ========== Getter 和 Setter 方法 ==========

    public String getPlateNumberName(){
        return plateNumberName;
    }

    public void setPlateNumberName(String plateNumberName){
        this.plateNumberName = plateNumberName;
    }

    public String getVehicleModel(){
        return vehicleModel;
    }

    public void setVehicleModel(String vehicleModel){
        this.vehicleModel = vehicleModel;
    }

    // ========== Object 方法重写 ==========

    @Override
    public boolean equals(Object o){
        if (this == o){
            return true;
        }
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        if (!super.equals(o)){
            return false;
        }

        TcPlateNumberQueryVO that = (TcPlateNumberQueryVO) o;

        return Objects.equals(plateNumberName, that.plateNumberName) &&
                Objects.equals(vehicleModel, that.vehicleModel);
    }

    @Override
    public int hashCode(){
        return Objects.hash(super.hashCode(), plateNumberName, vehicleModel);
    }

    @Override
    public String toString(){
        return "TcPlateNumberQueryVO{" +
                "plateNumberName='" + plateNumberName + '\'' +
                ", vehicleModel='" + vehicleModel + '\'' +
                "} " + super.toString();
    }
}
